<?xml version="1.0" encoding="UTF-8" ?>



<xsl:stylesheet version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
	xmlns:tmt="http://www.massimocorner.com/validator">
	<xsl:param name="DOTNET2"/>


	
	<xsl:output method="xml" indent="yes"/>
	
	
	

	<xsl:template match="Instance">

		 <xsl:variable name="EMPTY_GUID" select="'00000000-0000-0000-0000-000000000000'"/>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:tmt="http://www.massimocorner.com/validator">

	<head runat="server">
		<title><xsl:value-of select="Name"/></title>
		<style type="text/css">@import url(CSS/form.css);</style>
		<script  src="JS/moximo.js" type="text/javascript"></script>
		<script src="JS/YAHOO.js" type="text/javascript"></script>
		<script src="JS/Dom.js" type="text/javascript"></script>
		<script src="JS/generic.js" type="text/javascript"></script>
		
		<script type="text/javascript"><xsl:attribute name="src">JS/<xsl:value-of select="Name"/>.js</xsl:attribute></script>

		
		<xsl:if test="count(ClassAttribs/ClassAttributes[Type='DateTime'])&gt;0">  
		<style type="text/css">@import url(CalendarControl/calendar-blue.css);</style>
		<script type="text/javascript" src="CalendarControl/calendar.js"></script>
		<script type="text/javascript" src="CalendarControl/calendar-en.js"></script>
		<script type="text/javascript" src="CalendarControl/calendar-setup.js"></script>
		</xsl:if>
		
	</head>
	
	<body>

		
			
			
		
	
	
		<div id="loader"><img src="Images/loader.gif" alt="Loader" /></div>	
		<form onsubmit="return tmt_validateForm(this)" runat="server" tmt:validate="true"  tmt:callback="displayError">
			<xsl:attribute name="action"><xsl:value-of select="Name"/>.aspx</xsl:attribute>
			<xsl:attribute name="id">Form<xsl:value-of select="Name"/></xsl:attribute>
			
			<table>

				<xsl:variable name="Name" select="Name"/>
			
			<xsl:for-each select="ClassAttribs/ClassAttributes">
				<tr>
					<td>
						<xsl:value-of select="PropertyName"/>
					</td>
					
					<td>
						<xsl:if test="CType='single'">
							<xsl:choose>
								<xsl:when test="SqlSPType='varchar(256)'">
								
						<input type="text" tmt:errorclass="errorclass" tmt:maxlength="255" tmt:filters="nohtml" class="string">
							<xsl:attribute name="id">
								<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/>
							</xsl:attribute>
							<xsl:attribute name="tmt:message">
								<xsl:value-of select="Name"/> field has errors.
							</xsl:attribute>
						</input>

					</xsl:when>


					<xsl:when test="SqlSPType='ntext'">
						<textarea tmt:filters="nohtml" tmt:errorclass="errorclass" tmt:maxlength="4000" class="bigstring"><xsl:attribute name="id"><xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/></xsl:attribute>
	<xsl:attribute name="tmt:message"><xsl:value-of select="Name"/> field has errors.</xsl:attribute></textarea>
								</xsl:when>
								
								
								
								<xsl:when test="Type='DateTime'">
									<span class="pointer"><xsl:attribute name="id">
										<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/>_DT</xsl:attribute></span>
									<script type="text/javascript">
									      Calendar.setup(
										{
										  daFormat    : "%d %b %Y %H:%M",    // the date format
										  displayArea : "<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/>_DT",
										  showsTime   : "true"
										}
									      );
									</script>
								</xsl:when>
								
								
								<xsl:when test="Type='int'">
						<input type="text" tmt:errorclass="errorclass" tmt:required="true" tmt:pattern="integer" value="0">
							<xsl:attribute name="id">
								<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/></xsl:attribute>
							<xsl:attribute name="class">
								<xsl:value-of select="Type"/>
							</xsl:attribute>
							<xsl:attribute name="tmt:message"><xsl:value-of select="Name"/> field has errors.</xsl:attribute>
						</input>
								</xsl:when>
								
								
								<xsl:when test="Type='double'">
						<input type="text" tmt:errorclass="errorclass" tmt:required="true" tmt:pattern="number" value="0.0">
							<xsl:attribute name="id">
								<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/></xsl:attribute>
							<xsl:attribute name="class">
								<xsl:value-of select="Type"/>
							</xsl:attribute>
							<xsl:attribute name="tmt:message"><xsl:value-of select="Name"/> field has errors.</xsl:attribute>
						</input>					
								</xsl:when>
								
								<xsl:when test="Type='Guid'">
									<span><xsl:attribute name="id">
										<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/></xsl:attribute>
										<xsl:attribute name="class">
											<xsl:value-of select="Type"/>
										</xsl:attribute>
									<xsl:value-of select="$EMPTY_GUID"/></span>
								</xsl:when>

								<xsl:when test="Type='bool'">
									<input type="checkbox" checked="false">
										<xsl:attribute name="id"><xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/></xsl:attribute>
										<xsl:attribute name="class">
											<xsl:value-of select="Type"/>
										</xsl:attribute>
									</input>
									
								</xsl:when>
							</xsl:choose>
						</xsl:if>
						
						
						<xsl:if test="KnownClass='true'">
						
							<select class="KnownClass"><xsl:attribute name="id">
								<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/></xsl:attribute></select>
						
						</xsl:if>


						<xsl:if test="IsEnum='true'">

							<select class="enum">
								<xsl:attribute name="id">
									<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/>
								</xsl:attribute>
							</select>
							
						</xsl:if>
						
						
						
						<xsl:if test="CType='array'">
							<select multiple="multiple" class="array"><xsl:attribute name="id">
								<xsl:value-of select="$Name"/>_<xsl:value-of select="Name"/></xsl:attribute></select>
						</xsl:if>
					</td>
				</tr>
			</xsl:for-each>
			
				<tr>
					<td colspan="2" align="right"><input tmt:waitmessage="Please Wait" type="button" value="Handle Incoming">
					<xsl:attribute name="onclick">if ( tmt_validateForm( YAHOO.util.Dom.get ( 'Form<xsl:value-of select="Name"/>' ) ) ) { HandleIncoming<xsl:value-of select="Name"/>(); }</xsl:attribute></input>
					<br/>
					
					<input tmt:waitmessage="Please Wait" type="button" value="Save Unique">
					<xsl:attribute name="onclick">if ( tmt_validateForm( YAHOO.util.Dom.get ( 'Form<xsl:value-of select="Name"/>' ) ) ) { Save<xsl:value-of select="Name"/>( GuidGen () ); }</xsl:attribute></input>
					<br/>
					
					<input tmt:waitmessage="Please Wait" type="button" value="Save Single">
					<xsl:attribute name="onclick">if ( tmt_validateForm( YAHOO.util.Dom.get ( 'Form<xsl:value-of select="Name"/>' ) ) ) { Save<xsl:value-of select="Name"/>( EMPTY_GUID ); }</xsl:attribute></input>
					
					
					<input tmt:waitmessage="Please Wait" type="button" value="Load Single">
					<xsl:attribute name="onclick">Load<xsl:value-of select="Name"/>( EMPTY_GUID ); </xsl:attribute></input>

					</td>
				</tr>
				
				<!--<tr>
					<td colspan="2" align="right">
						<hr size="1"/>
						
						<input type="button" value="load"><xsl:attribute name="onclick">Load<xsl:value-of select="Name"/>();</xsl:attribute></input>
					
					</td>
				
				</tr>-->
			
			
			</table>
			
		</form>

		<script type="text/javascript">

			GetLoaded<xsl:value-of select="Name"/>();

		</script>
	
	</body>
</html>
	
	
[[[INCLUDE_HEADER]]]
	
	
	
	</xsl:template>
	
</xsl:stylesheet>